from django.db import models

# Create your models here.


# # 学习历史表
# class learn_history(models.Model):
#     learn_history_id = models.AutoField(primary_key=True)
#     user_id = models.IntegerField()
#     course_id = models.IntegerField()
#     progress = models.CharField(max_length=50)
#     learn_date = models.DateField()
#
#     def __str__(self):
#         return self.progress
#
#     class Meta:
#         db_table = 'learn_history'


# 问题与答案表
class QnA(models.Model):
    QnA_id = models.AutoField(primary_key=True)
    user_id = models.IntegerField()
    question = models.TextField()
    answer = models.TextField()

    def __str__(self):
        return self.question

    class Meta:
        db_table = 'QnA'


# 作业表
class work(models.Model):
    work_id = models.AutoField(primary_key=True)
    work_name = models.CharField(max_length=50)
    work_type = models.CharField(max_length=20, blank=True, null=True)
    # # 点赞总数
    # work_like_count = models.BigIntegerField(default=0, null=True)
    # # 点赞用户id
    # like_user_id = models.BigIntegerField(null=True)
    # # 收藏总数
    # work_favorite = models.BigIntegerField(default=0, null=True)
    # # 收藏用户id
    # favorite_user_id = models.BigIntegerField(null=True)

    def __str__(self):
        return self.work_name

    class Meta:
        db_table = 'work'


# 作业题目表
class work_topic(models.Model):
    work_id = models.IntegerField()
    work_topic_id = models.AutoField(primary_key=True)
    work_catalogue = models.CharField(max_length=255, blank=True, null=True)
    work_topic_type = models.CharField(max_length=255, blank=True, null=True)
    Bquestion_content = models.TextField(blank=True, null=True)
    Squestion_type = models.CharField(max_length=255, blank=True, null=True)
    Squestion_content = models.TextField(blank=True, null=True)
    answer = models.CharField(max_length=255, blank=True, null=True)
    answer_analysis = models.TextField(blank=True, null=True)
    difficulty_level = models.CharField(max_length=100, blank=True, null=True)
    knowledge_point = models.CharField(max_length=255, blank=True, null=True)
    program_objective = models.CharField(max_length=255, blank=True, null=True)
    score = models.CharField(max_length=255, blank=True, null=True)
    option = models.CharField(max_length=100, blank=True, null=True)
    A = models.CharField(max_length=100, blank=True, null=True)
    B = models.CharField(max_length=100, blank=True, null=True)
    C = models.CharField(max_length=100, blank=True, null=True)
    D = models.CharField(max_length=100, blank=True, null=True)

    class Meta:
        db_table = 'work_topic'


# 试卷表
class exam(models.Model):
    exam_id = models.AutoField(primary_key=True)
    exam_name = models.CharField(max_length=255)
    exam_type = models.CharField(max_length=100, blank=True, null=True)
    # # 点赞总数
    # exam_like_count = models.BigIntegerField(default=0, null=True)
    # # 点赞用户id
    # like_user_id = models.BigIntegerField(null=True)
    # # 收藏总数
    # exam_favorite = models.BigIntegerField(default=0, null=True)
    # # 收藏用户id
    # favorite_user_id = models.BigIntegerField(null=True)

    def __str__(self):
        return self.exam_name

    class Meta:
        db_table = 'exam'


# 试卷题目表
class exam_topic(models.Model):
    exam_id = models.IntegerField()
    exam_catalogue = models.CharField(max_length=255, blank=True, null=True)
    exam_topic_type = models.CharField(max_length=255, blank=True, null=True)
    Bquestion_content = models.TextField(blank=True, null=True)
    Squestion_type = models.CharField(max_length=255, blank=True, null=True)
    Squestion_content = models.TextField(blank=True, null=True)
    answer = models.CharField(max_length=255, blank=True, null=True)
    answer_analysis = models.TextField(blank=True, null=True)
    difficulty_level = models.CharField(max_length=100, blank=True, null=True)
    knowledge_point = models.TextField(blank=True, null=True)
    program_objective = models.TextField(blank=True, null=True)
    option = models.CharField(max_length=100, blank=True, null=True)
    A = models.CharField(max_length=100, blank=True, null=True)
    B = models.CharField(max_length=100, blank=True, null=True)
    C = models.CharField(max_length=100, blank=True, null=True)
    D = models.CharField(max_length=100, blank=True, null=True)
    exam_topic_id = models.AutoField(primary_key=True)

    class Meta:
        db_table = 'exam_topic'


# 题库
class question_bank(models.Model):
    question_bank_id = models.AutoField(primary_key=True)
    question_bank_catalogue = models.CharField(max_length=255, blank=True, null=True)
    question_bank_topic_type = models.CharField(max_length=255, blank=True, null=True)
    Bquestion_content = models.TextField(blank=True, null=True)
    Squestion_type = models.CharField(max_length=255, blank=True, null=True)
    Squestion_content = models.TextField(blank=True, null=True)
    answer = models.CharField(max_length=255, blank=True, null=True)
    answer_analysis = models.CharField(max_length=255, blank=True, null=True)
    difficulty_level = models.CharField(max_length=100, blank=True, null=True)
    knowledge_point = models.CharField(max_length=255, blank=True, null=True)
    option = models.CharField(max_length=255, blank=True, null=True)
    A = models.TextField(blank=True, null=True)
    B = models.TextField(blank=True, null=True)
    C = models.TextField(blank=True, null=True)
    D = models.TextField(blank=True, null=True)

    class Meta:
        db_table = 'question_bank'


# #  喜欢用户中间表
# class like_user(models.Model):
#     # 自增id
#     like_userid = models.AutoField(primary_key=True)
#     # 收藏文章
#     article_id = models.BigIntegerField()
#     # 收藏用户
#     like_user_id = models.BigIntegerField()
#
#     class Meta:
#         db_table = 'like_user'
#
#
# # 收藏用户中间表
# class favorite_user(models.Model):
#     # 自增id
#     favorite_user_id = models.AutoField(primary_key=True)
#     # 收藏文章
#     article_id = models.BigIntegerField()
#     # 收藏用户
#     like_user_id = models.BigIntegerField()
#
#     class Meta:
#         db_table = 'favorite_user'


